﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chefbook.HelperMethods;
using NUnit.Framework;

namespace UnitTests.HelperMethodsTests
{
    [TestFixture]
    public class CollectionExtensionMethodsFixture
    {
        [Test]
        public void AddIfNewTest1()
        {
            List<object> list1 = new List<object>();
            object a = new object();
            list1.AddIfNew(a);
            Assert.AreEqual(1, list1.Count((item) => item == a),"Object did not appear in collection exactly once");
        }
        [Test]
        public void AddIfNewTest2()
        {
            List<object> list1 = new List<object>();
            object a = new object();
            list1.AddIfNew(a);
            list1.AddIfNew(a);
            Assert.AreEqual(1, list1.Count((item) => item == a), "Object did not appear in collection exactly once");
        }

    }
}
